<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>affinetransform_test.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_closure_goog_math_affinetransform_test.js.html">affinetransform_test.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2008 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>goog.provide(&#39;goog.math.AffineTransformTest&#39;);
<a name="line16"></a>
<a name="line17"></a>goog.require(&#39;goog.array&#39;);
<a name="line18"></a>goog.require(&#39;goog.math&#39;);
<a name="line19"></a>goog.require(&#39;goog.math.AffineTransform&#39;);
<a name="line20"></a>goog.require(&#39;goog.testing.jsunit&#39;);
<a name="line21"></a>
<a name="line22"></a>goog.setTestOnly(&#39;goog.math.AffineTransformTest&#39;);
<a name="line23"></a>
<a name="line24"></a>function testGetTranslateInstance() {
<a name="line25"></a>  var tx = goog.math.AffineTransform.getTranslateInstance(2, 4);
<a name="line26"></a>  assertEquals(1, tx.getScaleX());
<a name="line27"></a>  assertEquals(0, tx.getShearY());
<a name="line28"></a>  assertEquals(0, tx.getShearX());
<a name="line29"></a>  assertEquals(1, tx.getScaleY());
<a name="line30"></a>  assertEquals(2, tx.getTranslateX());
<a name="line31"></a>  assertEquals(4, tx.getTranslateY());
<a name="line32"></a>}
<a name="line33"></a>
<a name="line34"></a>function testGetScaleInstance() {
<a name="line35"></a>  var tx = goog.math.AffineTransform.getScaleInstance(2, 4);
<a name="line36"></a>  assertEquals(2, tx.getScaleX());
<a name="line37"></a>  assertEquals(0, tx.getShearY());
<a name="line38"></a>  assertEquals(0, tx.getShearX());
<a name="line39"></a>  assertEquals(4, tx.getScaleY());
<a name="line40"></a>  assertEquals(0, tx.getTranslateX());
<a name="line41"></a>  assertEquals(0, tx.getTranslateY());
<a name="line42"></a>}
<a name="line43"></a>
<a name="line44"></a>function testGetRotateInstance() {
<a name="line45"></a>  var tx = goog.math.AffineTransform.getRotateInstance(Math.PI / 2, 1, 2);
<a name="line46"></a>  assertRoughlyEquals(0, tx.getScaleX(), 1e-9);
<a name="line47"></a>  assertRoughlyEquals(1, tx.getShearY(), 1e-9);
<a name="line48"></a>  assertRoughlyEquals(-1, tx.getShearX(), 1e-9);
<a name="line49"></a>  assertRoughlyEquals(0, tx.getScaleY(), 1e-9);
<a name="line50"></a>  assertRoughlyEquals(3, tx.getTranslateX(), 1e-9);
<a name="line51"></a>  assertRoughlyEquals(1, tx.getTranslateY(), 1e-9);
<a name="line52"></a>}
<a name="line53"></a>
<a name="line54"></a>function testGetShearInstance() {
<a name="line55"></a>  var tx = goog.math.AffineTransform.getShearInstance(2, 4);
<a name="line56"></a>  assertEquals(1, tx.getScaleX());
<a name="line57"></a>  assertEquals(4, tx.getShearY());
<a name="line58"></a>  assertEquals(2, tx.getShearX());
<a name="line59"></a>  assertEquals(1, tx.getScaleY());
<a name="line60"></a>  assertEquals(0, tx.getTranslateX());
<a name="line61"></a>  assertEquals(0, tx.getTranslateY());
<a name="line62"></a>}
<a name="line63"></a>
<a name="line64"></a>function testConstructor() {
<a name="line65"></a>  assertThrows(function() {
<a name="line66"></a>    new goog.math.AffineTransform([0, 0]);
<a name="line67"></a>  });
<a name="line68"></a>  assertThrows(function() {
<a name="line69"></a>    new goog.math.AffineTransform({});
<a name="line70"></a>  });
<a name="line71"></a>  assertThrows(function() {
<a name="line72"></a>    new goog.math.AffineTransform(0, 0, 0, &#39;a&#39;, 0, 0);
<a name="line73"></a>  });
<a name="line74"></a>
<a name="line75"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line76"></a>  assertEquals(1, tx.getScaleX());
<a name="line77"></a>  assertEquals(2, tx.getShearY());
<a name="line78"></a>  assertEquals(3, tx.getShearX());
<a name="line79"></a>  assertEquals(4, tx.getScaleY());
<a name="line80"></a>  assertEquals(5, tx.getTranslateX());
<a name="line81"></a>  assertEquals(6, tx.getTranslateY());
<a name="line82"></a>
<a name="line83"></a>  tx = new goog.math.AffineTransform();
<a name="line84"></a>  assert(tx.isIdentity());
<a name="line85"></a>}
<a name="line86"></a>
<a name="line87"></a>function testIsIdentity() {
<a name="line88"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line89"></a>  assertFalse(tx.isIdentity());
<a name="line90"></a>  tx.setTransform(1, 0, 0, 1, 0, 0);
<a name="line91"></a>  assert(tx.isIdentity());
<a name="line92"></a>}
<a name="line93"></a>
<a name="line94"></a>function testClone() {
<a name="line95"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line96"></a>  var copy = tx.clone();
<a name="line97"></a>  assertEquals(copy.getScaleX(), tx.getScaleX());
<a name="line98"></a>  assertEquals(copy.getShearY(), tx.getShearY());
<a name="line99"></a>  assertEquals(copy.getShearX(), tx.getShearX());
<a name="line100"></a>  assertEquals(copy.getScaleY(), tx.getScaleY());
<a name="line101"></a>  assertEquals(copy.getTranslateX(), tx.getTranslateX());
<a name="line102"></a>  assertEquals(copy.getTranslateY(), tx.getTranslateY());
<a name="line103"></a>}
<a name="line104"></a>
<a name="line105"></a>function testSetTransform() {
<a name="line106"></a>  var tx = new goog.math.AffineTransform();
<a name="line107"></a>  assertThrows(function() {
<a name="line108"></a>    tx.setTransform(1, 2, 3, 4, 6);
<a name="line109"></a>  });
<a name="line110"></a>  assertThrows(function() {
<a name="line111"></a>    tx.setTransform(&#39;a&#39;, 2, 3, 4, 5, 6);
<a name="line112"></a>  });
<a name="line113"></a>
<a name="line114"></a>  tx.setTransform(1, 2, 3, 4, 5, 6);
<a name="line115"></a>  assertEquals(1, tx.getScaleX());
<a name="line116"></a>  assertEquals(2, tx.getShearY());
<a name="line117"></a>  assertEquals(3, tx.getShearX());
<a name="line118"></a>  assertEquals(4, tx.getScaleY());
<a name="line119"></a>  assertEquals(5, tx.getTranslateX());
<a name="line120"></a>  assertEquals(6, tx.getTranslateY());
<a name="line121"></a>}
<a name="line122"></a>
<a name="line123"></a>function testScale() {
<a name="line124"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line125"></a>  tx.scale(2, 3);
<a name="line126"></a>  assertEquals(2, tx.getScaleX());
<a name="line127"></a>  assertEquals(4, tx.getShearY());
<a name="line128"></a>  assertEquals(9, tx.getShearX());
<a name="line129"></a>  assertEquals(12, tx.getScaleY());
<a name="line130"></a>  assertEquals(5, tx.getTranslateX());
<a name="line131"></a>  assertEquals(6, tx.getTranslateY());
<a name="line132"></a>}
<a name="line133"></a>
<a name="line134"></a>function testPreScale() {
<a name="line135"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line136"></a>  tx.preScale(2, 3);
<a name="line137"></a>  assertEquals(2, tx.getScaleX());
<a name="line138"></a>  assertEquals(6, tx.getShearY());
<a name="line139"></a>  assertEquals(6, tx.getShearX());
<a name="line140"></a>  assertEquals(12, tx.getScaleY());
<a name="line141"></a>  assertEquals(10, tx.getTranslateX());
<a name="line142"></a>  assertEquals(18, tx.getTranslateY());
<a name="line143"></a>}
<a name="line144"></a>
<a name="line145"></a>function testTranslate() {
<a name="line146"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line147"></a>  tx.translate(2, 3);
<a name="line148"></a>  assertEquals(1, tx.getScaleX());
<a name="line149"></a>  assertEquals(2, tx.getShearY());
<a name="line150"></a>  assertEquals(3, tx.getShearX());
<a name="line151"></a>  assertEquals(4, tx.getScaleY());
<a name="line152"></a>  assertEquals(16, tx.getTranslateX());
<a name="line153"></a>  assertEquals(22, tx.getTranslateY());
<a name="line154"></a>}
<a name="line155"></a>
<a name="line156"></a>function testPreTranslate() {
<a name="line157"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line158"></a>  tx.preTranslate(2, 3);
<a name="line159"></a>  assertEquals(1, tx.getScaleX());
<a name="line160"></a>  assertEquals(2, tx.getShearY());
<a name="line161"></a>  assertEquals(3, tx.getShearX());
<a name="line162"></a>  assertEquals(4, tx.getScaleY());
<a name="line163"></a>  assertEquals(7, tx.getTranslateX());
<a name="line164"></a>  assertEquals(9, tx.getTranslateY());
<a name="line165"></a>}
<a name="line166"></a>
<a name="line167"></a>function testRotate() {
<a name="line168"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line169"></a>  tx.rotate(Math.PI / 2, 1, 1);
<a name="line170"></a>  assertRoughlyEquals(3, tx.getScaleX(), 1e-9);
<a name="line171"></a>  assertRoughlyEquals(4, tx.getShearY(), 1e-9);
<a name="line172"></a>  assertRoughlyEquals(-1, tx.getShearX(), 1e-9);
<a name="line173"></a>  assertRoughlyEquals(-2, tx.getScaleY(), 1e-9);
<a name="line174"></a>  assertRoughlyEquals(7, tx.getTranslateX(), 1e-9);
<a name="line175"></a>  assertRoughlyEquals(10, tx.getTranslateY(), 1e-9);
<a name="line176"></a>}
<a name="line177"></a>
<a name="line178"></a>function testPreRotate() {
<a name="line179"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line180"></a>  tx.preRotate(Math.PI / 2, 1, 1);
<a name="line181"></a>  assertRoughlyEquals(-2, tx.getScaleX(), 1e-9);
<a name="line182"></a>  assertRoughlyEquals(1, tx.getShearY(), 1e-9);
<a name="line183"></a>  assertRoughlyEquals(-4, tx.getShearX(), 1e-9);
<a name="line184"></a>  assertRoughlyEquals(3, tx.getScaleY(), 1e-9);
<a name="line185"></a>  assertRoughlyEquals(-4, tx.getTranslateX(), 1e-9);
<a name="line186"></a>  assertRoughlyEquals(5, tx.getTranslateY(), 1e-9);
<a name="line187"></a>}
<a name="line188"></a>
<a name="line189"></a>function testShear() {
<a name="line190"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line191"></a>  tx.shear(2, 3);
<a name="line192"></a>  assertEquals(10, tx.getScaleX());
<a name="line193"></a>  assertEquals(14, tx.getShearY());
<a name="line194"></a>  assertEquals(5, tx.getShearX());
<a name="line195"></a>  assertEquals(8, tx.getScaleY());
<a name="line196"></a>  assertEquals(5, tx.getTranslateX());
<a name="line197"></a>  assertEquals(6, tx.getTranslateY());
<a name="line198"></a>}
<a name="line199"></a>
<a name="line200"></a>function testPreShear() {
<a name="line201"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line202"></a>  tx.preShear(2, 3);
<a name="line203"></a>  assertEquals(5, tx.getScaleX());
<a name="line204"></a>  assertEquals(5, tx.getShearY());
<a name="line205"></a>  assertEquals(11, tx.getShearX());
<a name="line206"></a>  assertEquals(13, tx.getScaleY());
<a name="line207"></a>  assertEquals(17, tx.getTranslateX());
<a name="line208"></a>  assertEquals(21, tx.getTranslateY());
<a name="line209"></a>}
<a name="line210"></a>
<a name="line211"></a>function testConcatentate() {
<a name="line212"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line213"></a>  tx.concatenate(new goog.math.AffineTransform(2, 1, 6, 5, 4, 3));
<a name="line214"></a>  assertEquals(5, tx.getScaleX());
<a name="line215"></a>  assertEquals(8, tx.getShearY());
<a name="line216"></a>  assertEquals(21, tx.getShearX());
<a name="line217"></a>  assertEquals(32, tx.getScaleY());
<a name="line218"></a>  assertEquals(18, tx.getTranslateX());
<a name="line219"></a>  assertEquals(26, tx.getTranslateY());
<a name="line220"></a>}
<a name="line221"></a>
<a name="line222"></a>function testPreConcatentate() {
<a name="line223"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line224"></a>  tx.preConcatenate(new goog.math.AffineTransform(2, 1, 6, 5, 4, 3));
<a name="line225"></a>  assertEquals(14, tx.getScaleX());
<a name="line226"></a>  assertEquals(11, tx.getShearY());
<a name="line227"></a>  assertEquals(30, tx.getShearX());
<a name="line228"></a>  assertEquals(23, tx.getScaleY());
<a name="line229"></a>  assertEquals(50, tx.getTranslateX());
<a name="line230"></a>  assertEquals(38, tx.getTranslateY());
<a name="line231"></a>}
<a name="line232"></a>
<a name="line233"></a>function testAssociativeConcatenate() {
<a name="line234"></a>  var x = new goog.math.AffineTransform(2, 3, 5, 7, 11, 13).concatenate(
<a name="line235"></a>      new goog.math.AffineTransform(17, 19, 23, 29, 31, 37));
<a name="line236"></a>  var y = new goog.math.AffineTransform(17, 19, 23, 29, 31, 37)
<a name="line237"></a>      .preConcatenate(new goog.math.AffineTransform(2, 3, 5, 7, 11, 13));
<a name="line238"></a>  assertEquals(x.getScaleX(), y.getScaleX());
<a name="line239"></a>  assertEquals(x.getShearY(), y.getShearY());
<a name="line240"></a>  assertEquals(x.getShearX(), y.getShearX());
<a name="line241"></a>  assertEquals(x.getScaleY(), y.getScaleY());
<a name="line242"></a>  assertEquals(x.getTranslateX(), y.getTranslateX());
<a name="line243"></a>  assertEquals(x.getTranslateY(), y.getTranslateY());
<a name="line244"></a>}
<a name="line245"></a>
<a name="line246"></a>function testTransform() {
<a name="line247"></a>  var srcPts = [0, 0, 1, 0, 1, 1, 0, 1];
<a name="line248"></a>  var dstPts = [];
<a name="line249"></a>  var tx = goog.math.AffineTransform.getScaleInstance(2, 3);
<a name="line250"></a>  tx.translate(5, 10);
<a name="line251"></a>  tx.rotate(Math.PI / 4, 5, 10);
<a name="line252"></a>  tx.transform(srcPts, 0, dstPts, 0, 4);
<a name="line253"></a>  assert(goog.array.equals(
<a name="line254"></a>      [27.071068, 28.180195, 28.485281, 30.301516,
<a name="line255"></a>       27.071068, 32.422836, 25.656855, 30.301516],
<a name="line256"></a>      dstPts,
<a name="line257"></a>      goog.math.nearlyEquals));
<a name="line258"></a>}
<a name="line259"></a>
<a name="line260"></a>function testGetDeterminant() {
<a name="line261"></a>  var tx = goog.math.AffineTransform.getScaleInstance(2, 3);
<a name="line262"></a>  tx.translate(5, 10);
<a name="line263"></a>  tx.rotate(Math.PI / 4, 5, 10);
<a name="line264"></a>  assertRoughlyEquals(6, tx.getDeterminant(), 0.001);
<a name="line265"></a>}
<a name="line266"></a>
<a name="line267"></a>function testIsInvertible() {
<a name="line268"></a>  assertTrue(new goog.math.AffineTransform(2, 3, 4, 5, 6, 7).
<a name="line269"></a>      isInvertible());
<a name="line270"></a>  assertTrue(new goog.math.AffineTransform(1, 0, 0, 1, 0, 0).
<a name="line271"></a>      isInvertible());
<a name="line272"></a>  assertFalse(new goog.math.AffineTransform(NaN, 0, 0, 1, 0, 0).
<a name="line273"></a>      isInvertible());
<a name="line274"></a>  assertFalse(new goog.math.AffineTransform(1, NaN, 0, 1, 0, 0).
<a name="line275"></a>      isInvertible());
<a name="line276"></a>  assertFalse(new goog.math.AffineTransform(1, 0, NaN, 1, 0, 0).
<a name="line277"></a>      isInvertible());
<a name="line278"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, NaN, 0, 0).
<a name="line279"></a>      isInvertible());
<a name="line280"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, 1, NaN, 0).
<a name="line281"></a>      isInvertible());
<a name="line282"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, 1, 0, NaN).
<a name="line283"></a>      isInvertible());
<a name="line284"></a>  assertFalse(new goog.math.AffineTransform(Infinity, 0, 0, 1, 0, 0).
<a name="line285"></a>      isInvertible());
<a name="line286"></a>  assertFalse(new goog.math.AffineTransform(1, Infinity, 0, 1, 0, 0).
<a name="line287"></a>      isInvertible());
<a name="line288"></a>  assertFalse(new goog.math.AffineTransform(1, 0, Infinity, 1, 0, 0).
<a name="line289"></a>      isInvertible());
<a name="line290"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, Infinity, 0, 0).
<a name="line291"></a>      isInvertible());
<a name="line292"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, 1, Infinity, 0).
<a name="line293"></a>      isInvertible());
<a name="line294"></a>  assertFalse(new goog.math.AffineTransform(1, 0, 0, 1, 0, Infinity).
<a name="line295"></a>      isInvertible());
<a name="line296"></a>  assertFalse(new goog.math.AffineTransform(0, 0, 0, 0, 1, 0).
<a name="line297"></a>      isInvertible());
<a name="line298"></a>}
<a name="line299"></a>
<a name="line300"></a>function testCreateInverse() {
<a name="line301"></a>  var tx = goog.math.AffineTransform.getScaleInstance(2, 3);
<a name="line302"></a>  tx.translate(5, 10);
<a name="line303"></a>  tx.rotate(Math.PI / 4, 5, 10);
<a name="line304"></a>  var inverse = tx.createInverse();
<a name="line305"></a>  assert(goog.math.nearlyEquals(0.353553, inverse.getScaleX()));
<a name="line306"></a>  assert(goog.math.nearlyEquals(-0.353553, inverse.getShearY()));
<a name="line307"></a>  assert(goog.math.nearlyEquals(0.235702, inverse.getShearX()));
<a name="line308"></a>  assert(goog.math.nearlyEquals(0.235702, inverse.getScaleY()));
<a name="line309"></a>  assert(goog.math.nearlyEquals(-16.213203, inverse.getTranslateX()));
<a name="line310"></a>  assert(goog.math.nearlyEquals(2.928932, inverse.getTranslateY()));
<a name="line311"></a>}
<a name="line312"></a>
<a name="line313"></a>function testCopyFrom() {
<a name="line314"></a>  var from = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line315"></a>  var to = new goog.math.AffineTransform();
<a name="line316"></a>  to.copyFrom(from);
<a name="line317"></a>  assertEquals(from.getScaleX(), to.getScaleX());
<a name="line318"></a>  assertEquals(from.getShearY(), to.getShearY());
<a name="line319"></a>  assertEquals(from.getShearX(), to.getShearX());
<a name="line320"></a>  assertEquals(from.getScaleY(), to.getScaleY());
<a name="line321"></a>  assertEquals(from.getTranslateX(), to.getTranslateX());
<a name="line322"></a>  assertEquals(from.getTranslateY(), to.getTranslateY());
<a name="line323"></a>}
<a name="line324"></a>
<a name="line325"></a>function testToString() {
<a name="line326"></a>  var tx = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line327"></a>  assertEquals(&#39;matrix(1,2,3,4,5,6)&#39;, tx.toString());
<a name="line328"></a>}
<a name="line329"></a>
<a name="line330"></a>function testEquals() {
<a name="line331"></a>  var tx1 = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line332"></a>  var tx2 = new goog.math.AffineTransform(1, 2, 3, 4, 5, 6);
<a name="line333"></a>  assertEqualsMethod(tx1, tx2, true);
<a name="line334"></a>
<a name="line335"></a>  tx2 = new goog.math.AffineTransform(-1, 2, 3, 4, 5, 6);
<a name="line336"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line337"></a>
<a name="line338"></a>  tx2 = new goog.math.AffineTransform(1, -1, 3, 4, 5, 6);
<a name="line339"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line340"></a>
<a name="line341"></a>  tx2 = new goog.math.AffineTransform(1, 2, -3, 4, 5, 6);
<a name="line342"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line343"></a>
<a name="line344"></a>  tx2 = new goog.math.AffineTransform(1, 2, 3, -4, 5, 6);
<a name="line345"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line346"></a>
<a name="line347"></a>  tx2 = new goog.math.AffineTransform(1, 2, 3, 4, -5, 6);
<a name="line348"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line349"></a>
<a name="line350"></a>  tx2 = new goog.math.AffineTransform(1, 2, 3, 4, 5, -6);
<a name="line351"></a>  assertEqualsMethod(tx1, tx2, false);
<a name="line352"></a>}
<a name="line353"></a>
<a name="line354"></a>function assertEqualsMethod(tx1, tx2, expected) {
<a name="line355"></a>  assertEquals(expected, tx1.equals(tx2));
<a name="line356"></a>  assertEquals(expected, tx2.equals(tx1));
<a name="line357"></a>  assertEquals(true, tx1.equals(tx1));
<a name="line358"></a>  assertEquals(true, tx2.equals(tx2));
<a name="line359"></a>}
</pre>


</body>
</html>
